package com.ldzy.dao;

import com.ldzy.pojo.C_class;
import com.ldzy.pojo.S_student;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface C_classDao {
    @Select("select * from c_class where id=#{id}")
    public C_class finById(int id);
    @Select("select * from c_class")
    public List<C_class> finByAll();
    @Select("select * from c_class where classname=#{classname}")
    public List<C_class> finByAllname();
    @Select("select s.name,s.age,c.classname from s_student s,c_class c where s.id=c.id and c.classname=#{classname}")
    @Results(@Result(property = "s_students",column = "s_students",many=@Many(select = "com.ldzy.dao.S_studentDao.finByAll")))
    public  void finByClass (int id);
}
